package com.hspedu.newData.dmsxl.数组;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-06 
 * @Version: 1.0
 */

public class LC1431拥有最多糖果的孩子 {

    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {

        int max = 0;
        for (int i = 0; i < candies.length; i++) {
            if (max < candies[i]){
                max = candies[i];
            }
        }

        List<Boolean> res = new ArrayList<>();
        for (int i = 0; i < candies.length; i++) {
            if (candies[i] + extraCandies >= max){
                res.add(true);
            }else {
                res.add(false);
            }
        }
        return res;
    }
}
